﻿using Looptribe.Moodlin8.ViewModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Looptribe.Moodlin8.UIHelper
{
    public class CoursesGridTemplateSelector : DataTemplateSelector
    {
        public DataTemplate Biggest { get; set; }
        public DataTemplate Bigger { get; set; }
        public DataTemplate Normal { get; set; }

        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            var course = ((CoursesCourseWrapper) item).Course;
            if (course.Id == 1)
            {
                return Biggest;
            }
            else if (course.Id > 1 && course.Id < 6)
            {
                return Bigger;
            }
            else
            {
                return Normal;
            }
        }
    }
}
